<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Silverlight.Weblog.UI.Web.Controllers.BlogPostDisplayData>" %>
<%@ Import Namespace="Silverlight.Weblog.Server.DAL"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title><%= Model.Title %></title>
    <style type="text/css">
        html, body
        {
            height: 100%;
            overflow: hidden;
        }
        body
        {
            padding: 0;
            margin: 0;
        }
        #silverlightControlHost
        {
            height: 100%;
            text-align: center;
        }
    </style>

    <script type="text/javascript" src="<%= ViewData["DirectoryPrefix"] %>Silverlight.js"></script>
    <script type="text/javascript">
        function onSourceDownloadProgressChanged(sender, eventArgs) {
            sender.findName("txt1").Text = Math.round((eventArgs.progress * 100)) + "%";
            sender.findName("txt2").Text = Math.round((eventArgs.progress * 100)) + "%";
            sender.findName("txt3").Text = Math.round((eventArgs.progress * 100)) + "%";
            sender.findName("txt4").Text = Math.round((eventArgs.progress * 100)) + "%";
        }

        function focusOnLoad() {
            var slPlugin = document.getElementById("silverlightObject");
            slPlugin.focus();
        }
    </script>
</head>
<body>
    <form id="form1" runat="server" style="height: 100%">
    <div id="silverlightControlHost">
        <object id="silverlightObject"
            data="data:application/x-silverlight-2," type="application/x-silverlight-2"
            width="100%" height="100%">
            <param name="splashscreensource" value="SplashScreen/SplashScreen.xaml"/>
            <param name="onSourceDownloadProgressChanged" value="onSourceDownloadProgressChanged" />
            <param name="source" value="<%= ViewData["DirectoryPrefix"] %>ClientBin/Silverlight.Weblog.UI.xap" />
            <param name="onError" value="onSilverlightError" />
            <param name="background" value="white" />
            <param name="minRuntimeVersion" value="3.0.40624.0" />
            <param name="autoUpgrade" value="true" />
            <param name="onload" value="focusOnLoad"/>
            <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration: none">
                <img src="GetSilverlight.jpg" alt="This Blog uses Silverlight. Get Silverlight now by clicking here."
                    style="border-style: none; text-align:center" />
            </a><br />
            <div id="Content" style="text-align:left;">
                <% if (Model.SingleBlogPost != null)
                   {%>
                    <!-- Begin BlogPost Data -->
                        <%= "<!-- PermlinkStart:" + Model.SingleBlogPost.Permlink + " PermlinkEnd-->"%>
                        <%= "<!-- TitleStart:" + Model.SingleBlogPost.Title + " TitleEnd-->"%>
                        <h1><%= Model.SingleBlogPost.Title%></h1>
                        <!-- Begin BlogPost Content -->
                        <%= Model.SingleBlogPost.HTML%>
                        <!-- End BlogPost Content -->
                    <!-- End BlogPost Data -->
                <% } %>
                <% if (Model.CollectionBlogPosts != null && Model.CollectionBlogPosts.Any())
                   {%>
                    <!-- Begin BlogPosts Data -->
                        <% foreach (BlogPost blogPost in Model.CollectionBlogPosts) {%>
                        <%= "<!-- PermlinkStart:" + blogPost.Permlink + " PermlinkEnd-->" %>
                        <%= "<!-- TitleStart:" + blogPost.Title + " TitleEnd-->"%>
                        <h1><%= blogPost.Title%></h1>
                        <!-- Begin BlogPost Content -->
                        <%= blogPost.HTML%>
                        <!-- End BlogPost Content -->
                        <!-- BlogPosts Split -->
                        <% } %>
                    <!-- End BlogPosts Data -->
                <% } %>
            </div>
        </object> <iframe id="_sl_historyFrame" style="visibility: hidden; height: 0px; width: 0px;border: 0px"></iframe>
<script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
    try {
        var pageTracker = _gat._getTracker("UA-12257058-1");
        pageTracker._setDomainName("none");
        pageTracker._setAllowLinker(true);
        pageTracker._trackPageview();
    } catch (err) { }</script>
    </div>
    </form>
</body>
</html>